int  sockfd=socket(ipv4,udp/tcp,);

struct sockaddr_in server;
server.port=;
server.ip=;
server.addr=;

bind(sockfd,&server,len);

listen(sockfd,5);


int fd=epoll_create(5);  //创建epoll模型

fd------sockfd
epoll_event events[num]={0};

while(1)
{
  int readnum=epoll_wait(fd,events,num,0);
 epoll_event  ev;
 ev.data.fd=sockfd;
 ev.event=epollin;
 for(int i=0;i<num;i++)
   {
       if(events[i].data.fd==sockfd)
       {
          int newfd=accept(sockfd,&client,len);
   
           epoll_ctl(fd,ctl_add,newfd,&ev);

       }
      else
       {   memset(buffer,0,sizeof(buffer);
           int n=recv(events[i].data.fd,buffer,sizeof(buffer),0);
           if(n>0)
            {
               buffer[n]='\0';
               cout<<buffer<<endl;



           }
         else if(n==0) 
          {
                 epoll_ctl(fd,ctl_del,events[i].data.fd,nullptr);




          }


       }





   }
  




}
